//
//  ValidationLog.swift
//  hello
//
//  Created by 赵康 on 2025/2/16.
//
import Vapor
import Fluent

final class ValidationLog: Model, @unchecked Sendable  {
  static var schema: String { SchemaEnum.validationLogs.rawValue }
  
  @ID(key: .id)
  var id: UUID?
  
  @Field(key: FieldKeys.albumId)
  var albumId: UUID
  
  @Field(key: FieldKeys.oldWordCount)
  var oldWordCount: Int
  
  @Field(key: FieldKeys.newWordCount)
  var newWordCount: Int
  
  @Timestamp(key: FieldKeys.createdAt, on: .create)
  var createdAt: Date?
  
  init() {}
  
  init(
    id: UUID? = nil,
    albumId: UUID,
    oldWordCount: Int,
    newWordCount: Int,
    createdAt: Date?
  ) {
    self.id = id
    self.albumId = albumId
    self.oldWordCount = oldWordCount
    self.newWordCount = newWordCount
    self.createdAt = createdAt
  }
}

